<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Cache" content="no-cache">
<title>Edit</title>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/static/css/pageBaseStyle.css">
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/static/css/calendar.css">
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/calendar.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/pageJs.js"></script>
<script type="text/javascript">
$(function(){
	text = $("#brith").val()
	$("#brith").val(text.slice(0,10))
})
</script>
</head>
<body>
	<h3>修改学生</h3>
	<form action="stu_edit" method="post" autocomplete="off">
		<table border="1" style="border-collapse:collapse;width:100%;">
			<tr>
				<td>学号</td>
				<td>姓名</td>
				<td>性别</td>
				<td>电话</td>
				<td>生日</td>
				<td>地址</td>
				<td>班级名</td>
			</tr>
			<tr>
				<td><input type="text" name="id" value="${editStudent.id }" readonly="readonly"></td>
				<td><input type="text" name="name" value="${editStudent.name }"></td>
				<c:if test="${editStudent.sex eq 0}">
					<td>
						<input type="radio" name="sex" value="0" checked>女
						<input type="radio" name="sex" value="1">男
					</td>
				</c:if>
				<c:if test="${editStudent.sex eq 1 }">
					<td>
						<input type="radio" name="sex" value="0">女
						<input type="radio" name="sex" value="1" checked>男
					</td>
				</c:if>
				<td><input type="text" name="phone" value="${editStudent.phone }"></td>
				<td><input type="text" name="brith" id="brith" value="${editStudent.brith }"><span id="dd"></span></td>
				<td><input type="text" name="address" value="${editStudent.address }"></td>
				<td>
					<select name="grade.id">
						<option value="${editStudent.grade.id }">${editStudent.grade.name }</option>
						<c:forEach items="${grades }" var="grade">
							<c:if test="${grade.id ne editStudent.grade.id}">
								<option value="${grade.id }">${grade.name }</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
		</table>
		<input type="submit" value="修改" />
		<input type="reset" value="重置" />
	</form>
</body>
</html>